<?php

namespace app\common\model\mycurrency;

use think\Model;

class OperateDistributionMoneyWithdrawal extends Model
{
    // 表名
    protected $name = 'mycurrency_operate_distribution_money_withdrawal';

    // 追加属性
    protected $append = [
        'status_text',
        'payment_mode_text',
    ];

    const STATUS_QUXIAO = -1;//状态 = 取消
    const STATUS_BOHUI = -2;//状态 = 提现驳回
    const STATUS_DAICHULI = 1;//状态 = 待处理
    const STATUS_SHENHETONGGUO = 2;//状态 = 审核通过待打款
    const STATUS_DAKUANZHONG = 3;//状态 = 打款中
    const STATUS_YIDAKUAN = 4;//状态 = 已打款

    const PAYMENT_MODE_WEIXIN = 1;//体现方式 = 微信打款
    const PAYMENT_MODE_ZHIFUBAO = 2;//体现方式 = 支付宝打款
    const PAYMENT_MODE_XIANXIA = 3;//体现方式 = 线下打款
    const PAYMENT_MODE_WEIXINSHOUKUANMA     = 4;//提现方式:4=微信收款码收款
    const PAYMENT_MODE_ZHIFUBAOSHOUKUANMA   = 5;//提现方式:5=支付宝收款码收款

    



    public function getApplytimeAttr($value){
        return $value != null ? date('Y-m-d H:i:s', $value) : '';
    }

    public function getRejecttimeAttr($value){
        return $value != null ? date('Y-m-d H:i:s', $value) : '';
    }

    public function getToexaminttimeAttr($value){
        return $value != null ? date('Y-m-d H:i:s', $value) : '';
    }

    public function getPaymenttimeAttr($value){
        return $value != null ? date('Y-m-d H:i:s', $value) : '';
    }


    public function getStatusTextAttr($value, $data)
    {
        $value = $value ? $value : (isset($data['status']) ? $data['status'] : '');
        $list = [
            '-1' => __('已取消'),
            '-2' => __('提现驳回'),
            '1' => __('待处理'),
            '2' => __('审核通过待打款'),
            '3' => __('打款中'),
            '4' => __('已打款'),
        ];
        return isset($list[$value]) ? $list[$value] : '';
    }

    public function getPaymentModeTextAttr($value, $data)
    {
        $value = $value ? $value : (isset($data['payment_mode']) ? $data['payment_mode'] : '');
        $list = [
            '1' => __('微信打款'),
            '2' => __('支付宝打款'),
            '3' => __('线下打款'),
        ];
        return isset($list[$value]) ? $list[$value] : '';
    }




    
}
